#  python连接mysql数据
import pymysql
'''
    参数一：host
    参数二：user
    参数三：password
    参数四：database
'''
connect = pymysql.connect("localhost", "root", "root", "test")

cursor = connect.cursor()

sql = "select * from parameter"

try:
    cursor.execute(sql)
    #获取当前条记录
    fetchone = cursor.fetchone()
    # fetchall = cursor.fetchall()
except:
    print("Error: unable to fecth data")

parameter = list(fetchone)

delta = parameter[0]
delta1 = parameter[1]
delta2 = parameter[2]
beta = parameter[3]
theta = parameter[4]
theta2 = parameter[5]
P1 = parameter[6]
P2 = parameter[7]
gt = parameter[8]
maigratin_asymptomatic_rate = parameter[9]
maigratin_infected_rate = parameter[10]
maigratin_hide_rate = parameter[11]
person_Fixed_latentperiod = parameter[12]
detection_accuracy = parameter[13]
detections_data_day1 = parameter[14]
detections_data_day2 = parameter[15]
detections_data_day3 = parameter[16]
discovery_rate_1 = parameter[17]
discovery_rate_2 = parameter[18]
cure_rate = parameter[19]
death_rate = parameter[20]
throw_number = parameter[21]

connect.close()

